package com.jiang.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

/**
 * MemberDetails entity. @author MyEclipse Persistence Tools
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "member_details", catalog = "mldn")
public class MemberDetails implements java.io.Serializable {


	private String mid;
	private MemberBasic memberBasic;
	private Integer age;
	private String sex;

	// Constructors

	/** default constructor */
	public MemberDetails() {
	}

	/** minimal constructor */
	public MemberDetails(String mid, MemberBasic memberBasic) {
		this.mid = mid;
		this.memberBasic = memberBasic;
	}

	/** full constructor */
	public MemberDetails(String mid, MemberBasic memberBasic, Integer age, String sex) {
		this.mid = mid;
		this.memberBasic = memberBasic;
		this.age = age;
		this.sex = sex;
	}

	// Property accessors
	@Id
	@Column(name = "mid", unique = true, nullable = false, length = 50)
	public String getMid() {
		return this.mid;
	}

	public void setMid(String mid) {
		this.mid = mid;
	}

	@OneToOne(fetch = FetchType.LAZY) // 配置级联
	@PrimaryKeyJoinColumn
	public MemberBasic getMemberBasic() {
		return this.memberBasic;
	}

	public void setMemberBasic(MemberBasic memberBasic) {
		this.memberBasic = memberBasic;
	}

	@Column(name = "age")
	public Integer getAge() {
		return this.age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Column(name = "sex", length = 20)
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

}